<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Login</title>
    <link href="jquery.mobile-1.3.2.min.css" rel="stylesheet" />
    <link href="mytheme.css" rel="stylesheet" />
    <script src="jquery-1.8.3.min.js"></script>
    <script src="jquery.mobile-1.3.2.min.js"></script>
</head>

<body>
    <div data-role="page" id="page1" data-theme="a">
        <div data-role="header">
            <a href="#second" data-icon="arrow-l">返回</a>
            <h1>用户注册</h1>
        </div>
        <div data-role="main" class="ui-content">
            <form method="post" id="registform">
				<label for="name">用户名</label>
                <input type="text" name="name" id="name" />
                <label for="identityType">邮 箱</label>
                <input type="text" name="identityType" id="identityType" />
                <label for="password">密 码</label>
                <input type="password" name="password" id="password" />
                <label for="nickname">昵 称</label>
                <input type="text" name="nickname" id="nickname" />
                <fieldset data-role="controlgroup">
                    <legend>身 份:</legend>
                    <input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" checked="checked" />
                    <label for="radio-choice-1">上班族</label>

                    <input type="radio" name="radio-choice-1" id="radio-choice-2" value="choice-2" />
                    <label for="radio-choice-2">大学生</label>

                    <input type="radio" name="radio-choice-1" id="radio-choice-3" value="choice-3" />
                    <label for="radio-choice-3">其他</label>
                </fieldset>

                <a data-role="button" data-rel="popup" id="regist" href="#showdialog" data-theme="e">立即注册</a>
                
            </form>

        </div>

        <div data-role="footer" data-position="fixed">
            <h1> 订购专线：90917777</h1>
        </div>

    </div>

    <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js""></script>
      <script type="text/javascript">
	  $('#regist').click(function() {
		  		  $.ajax({
					method:"POST",
					url:"http://182.61.26.165:8000/smis/user/addUser",
					contentType:"application/json;charset=utf-8",
					data:JSON.stringify({"name":$('#name').val(),"email":$('#email').val(),"password":$('#password').val(),"nickname":$('#nickname').val(),"radio-choice-1":$('input:radio:checked').val()}),
					dataType:"json",
					success:function(data){
						alert.log(data.msg);
					},
						error:function(message){
							console.log('123');
					},
				});
				 
			)};
        // $(document).ready(function () {
           
        //  });
      </script>
</body>
</body>

</html>